import request from '@/utils/request'

export default {
  //查询角色
  selectRoleList(pagination) {
    return request({
      url: "/rbac/role/list",
      method: "get",
      params: pagination
    })
  },
  //删除角色
  deleteRole(id) {
    return request({
      url: "/rbac/role/delete",
      method: "post",
      params: {id}
    })
  },
  //更新角色信息
  updateRole(data) {
    return request({
      url: "/rbac/role/update",
      method: "post",
      data
    })
  },
  //添加角色
  addRole(data) {
    return request({
      url: '/rbac/role/add',
      method: 'post',
      data
    })
  },
  //根据id查询角色
  selectRoleById(id) {
    return request({
      url: "/rbac/role/selectById",
      method: "get",
      params: {id}
    })
  },
  //查询所有角色
  selectAllRole(){
    return request({
      url: "/rbac/role/selectAll",
      method: "get",
    })
  },
  //查询树形角色
  selectRoleTreeList(){
    return request({
      url: "/rbac/role/selectTreeList",
      method: "get",
    })
  }
}
